import Vue from 'vue'
import VueRouter from 'vue-router'
//引入组件
import Home from '../views/Home.vue'
import category from'../views/category.vue'
import special from'../views/special.vue'
import cart from'../views/cart.vue'
import me from'../views/me.vue'
import categoryList from '../components/categoryList.vue'
Vue.use(VueRouter)

const routes = [ 
  {path:'/', redirect:'/home'},
  {path:'/home', component:Home},
  {path:'/category', component:category},
  {path:'/special', component:special},
  {path:'/cart', component:cart},
  {path:'/me', component:me},
  {path:'/category/:id', component:categoryList}
]

const router = new VueRouter({
  routes
})

export default router
